<% content_for :page_head do %>
  <h1>项目列表</h1>
<% end %>

<div id="projects_info">
  <%= render :partial => @projects %>
</div>
<% content_for :right_side do %>
<div class="personal_info_wrapper">
  <div id="my_task" class="sidebar_form my_task">
    <div class="inner task">
      <div class="header">
        <h1>分配给我的任务</h1>
      </div>
      <div class="body">
        <div class="assign_info">
          <div class="issue_info">
            <p>所有 Issue: <%= link_to (current_user.assigned_issues.count_open_issues("S").to_i +
                                        current_user.assigned_issues.count_open_issues("A").to_i +
                                        current_user.assigned_issues.count_open_issues("B").to_i).to_s,
                                              :controller => :issues,
                                              :action => :index,
                                              :user_id => current_user,
                                              :issue_type => "all" %> 个</p>
          </div>
          <div class="issue_info">
            <p>S类 Issue: <%= link_to current_user.assigned_issues.count_open_issues("S"),
                                              :controller => :issues,
                                              :action => :index,
                                              :user_id => current_user,
                                              :issue_type => "S" %> 个</p>
          </div>
          <div class="issue_info">
            <p>A类 Issue: <%= link_to current_user.assigned_issues.count_open_issues("A"),
                                              :controller => :issues,
                                              :action => :index,
                                              :user_id => current_user,
                                              :issue_type => "A" %> 个</p>
          </div>
          <div class="issue_info">
            <p>B类 Issue: <%= link_to current_user.assigned_issues.count_open_issues("B"),
                                              :controller => :issues,
                                              :action => :index,
                                              :user_id => current_user,
                                              :issue_type => "B" %> 个</p>
          </div>
          <div class="issue_info">
            <p>需求: <%= link_to current_user.requirements.count_unfinished_requirements,
                                              :controller => :requirements,
                                              :action => :index,
                                              :user_id => current_user %> 个</p>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
<% end %>